import request from '@/utils/request'

export function login(username, password) {
  const params = new URLSearchParams()
  params.append('username', username)
  params.append('password', password)
  return request({
    url: '/login',
    method: 'post',
    data: params
  })
}

/**
 * 获取菜单
 * @param token
 */
export function getInfo(token) {
  const params = { 'token': token }
  return request({
    url: '/menus',
    method: 'get',
    params
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}
